package avicit.bdp.dds.dao.entity;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.Id;
import io.swagger.annotations.ApiModel;

import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;

/**
 * DS命令实体类(bdp_command)
 */
@ApiModel(value = "CommandDto", description = "bdp_command")
@Table(name = "bdp_command")
public class Command extends BaseDTO {
    /**
     * id
     */
    @Id
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * command type
     */
    @Column(name = "command_type")
    private Integer commandType;

    /**
     * process definition id
     */
    @Column(name = "process_definition_id")
    private String processDefinitionId;

    /**
     * command parameter, format json
     */
    @Column(name = "command_param")
    private String commandParam;

    /**
     * task depend type
     */
    @Column(name = "task_depend_type")
    private Integer taskDependType;

    /**
     * failure strategy
     */
   @Column(name = "failure_strategy")
    private Integer failureStrategy;

    /**
     * warning type
     */
    @Column(name = "warning_type")
    private Integer warningType;

    /**
     * 告警用户列表
     */
    @Column(name = "warning_user_ids")
    private String warningUserIds;

    /**
     * schedule time
     */
    @Column(name = "schedule_time")
    private Date scheduleTime;

    /**
     * start time
     */
    @Column(name = "start_time")
    private Date startTime;

    /**
     * executor id
     */
    @Column(name = "executor_id")
    private String executorId;

    /**
     * dependence
     */
    @Column(name = "dependence")
    private String dependence;

    /**
     * process instance priority //Priority
     */
    @Column(name = "process_instance_priority")
    private Integer processInstancePriority;


    /**
     * worker group
     */
    @Column(name = "worker_group")
    private String workerGroup;

    public Command() {
    	
    }

    public Command(
            Integer commandType,
            Integer taskDependType,
            Integer failureStrategy,
            String executorId,
            String processDefinitionId,
            String commandParam,
            Integer warningType,
            String warningUserIds,
            Date scheduleTime,
            Integer processInstancePriority) {
        this.commandType = commandType;
        this.executorId = executorId;
        this.processDefinitionId = processDefinitionId;
        this.commandParam = commandParam;
        this.warningType = warningType;
        this.warningUserIds = warningUserIds;
        this.scheduleTime = scheduleTime;
        this.taskDependType = taskDependType;
        this.failureStrategy = failureStrategy;
        this.startTime = new Date();
        this.lastUpdateDate = new Date();
        this.processInstancePriority = processInstancePriority;
    }

    public String getId() {
        return id;
    }

    public Integer getCommandType() {
        return commandType;
    }

    public String getProcessDefinitionId() {
        return processDefinitionId;
    }

    public String getCommandParam() {
        return commandParam;
    }

    public Integer getTaskDependType() {
        return taskDependType;
    }

    public Integer getFailureStrategy() {
        return failureStrategy;
    }

    public Integer getWarningType() {
        return warningType;
    }

    public String getWarningUserIds() {
        return warningUserIds;
    }

    public Date getScheduleTime() {
        return scheduleTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public String getExecutorId() {
        return executorId;
    }

    public String getDependence() {
        return dependence;
    }

    public Integer getProcessInstancePriority() {
        return processInstancePriority;
    }

    public String getWorkerGroup() {
        return workerGroup;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setCommandType(Integer commandType) {
        this.commandType = commandType;
    }

    public void setProcessDefinitionId(String processDefinitionId) {
        this.processDefinitionId = processDefinitionId;
    }

    public void setCommandParam(String commandParam) {
        this.commandParam = commandParam;
    }

    public void setTaskDependType(Integer taskDependType) {
        this.taskDependType = taskDependType;
    }

    public void setFailureStrategy(Integer failureStrategy) {
        this.failureStrategy = failureStrategy;
    }

    public void setWarningType(Integer warningType) {
        this.warningType = warningType;
    }

    public void setWarningUserIds(String warningUserIds) {
        this.warningUserIds = warningUserIds;
    }

    public void setScheduleTime(Date scheduleTime) {
        this.scheduleTime = scheduleTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public void setExecutorId(String executorId) {
        this.executorId = executorId;
    }

    public void setDependence(String dependence) {
        this.dependence = dependence;
    }

    public void setProcessInstancePriority(Integer processInstancePriority) {
        this.processInstancePriority = processInstancePriority;
    }

    public void setWorkerGroup(String workerGroup) {
        this.workerGroup = workerGroup;
    }

    @Override
    public String toString() {
        return "Command{" +
                "id='" + id + '\'' +
                ", commandType=" + commandType +
                ", processDefinitionId='" + processDefinitionId + '\'' +
                ", commandParam='" + commandParam + '\'' +
                ", taskDependType=" + taskDependType +
                ", failureStrategy=" + failureStrategy +
                ", warningType=" + warningType +
                ", warningUserIds='" + warningUserIds + '\'' +
                ", scheduleTime=" + scheduleTime +
                ", startTime=" + startTime +
                ", executorId='" + executorId + '\'' +
                ", dependence='" + dependence + '\'' +
                ", processInstancePriority=" + processInstancePriority +
                ", workerGroup='" + workerGroup + '\'' +
                '}';
    }
}
